﻿Public Class F59_M

    Private Sub btnguardar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnguardar.Click
        If (Len(txtnumcontrol.Text) = 0) Then
            MsgBox("EL Número de formulario es un campo obligatorio", MsgBoxStyle.Exclamation)
            txtnumcontrol.Focus()
            Exit Sub
        End If
        Dim oF59MNegocios As New Negocios.NF59_M
        Dim oF59M As New Entidades.EF59_M
        oF59M.numcontroll = UCase(txtnumcontrol.Text)
        oF59M.apellidoo = UCase(txtapellido.Text)
        oF59M.nombree = UCase(txtnombre.Text)
        oF59M.docc = UCase(txtdoc.Text)
        oF59M.domicilioo = UCase(txtdomicilio.Text)
        oF59M.numm = UCase(txtnum.Text)
        oF59M.pisoo = UCase(txtpiso.Text)
        oF59M.dptoo = UCase(txtdpto.Text)
        oF59M.localidadd = UCase(txtlocalidad.Text)
        oF59M.provinciaa = UCase(txtprovincia.Text)
        oF59M.codpostall = UCase(txtcodpostal.Text)
        oF59M.matriculaa = UCase(txtmatricula.Text)
        oF59M.matriculamandd = UCase(txtmatriculamand.Text)
        oF59M.dominioo = UCase(txtdominio.Text)
        oF59M.tramitee = UCase(txttramite.Text)
        oF59M.solicitudtipoo = UCase(txtsolicitudtipo.Text)
        oF59M.numerocontroll = UCase(txtnumerocontrol.Text)
        oF59M.observacioness = UCase(txtobservaciones.Text)
    

        Try
            If oF59MNegocios.guardarF59M(oF59M) Then
                MsgBox("La carga ha sido exitosa", MsgBoxStyle.MsgBoxSetForeground, "Información")
            End If
        Catch ex As Exception
            MsgBox("carga fallida. " + ex.Message, MsgBoxStyle.MsgBoxSetForeground, "Información")
        End Try
    End Sub

    Private Sub btnEditarAnverso_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnEditarAnverso.Click


        If (Len(txtnumcontrol.Text) = 0) Then
            MsgBox("EL Número de formulario es un campo obligatorio", MsgBoxStyle.Exclamation)
            txtnumcontrol.Focus()
            Exit Sub
        End If
        Dim oF59MNegocios As New Negocios.NF59_M
        Dim oF59M As New Entidades.EF59_M
        oF59M.numcontroll = UCase(txtnumcontrol.Text)
        oF59M.apellidoo = UCase(txtapellido.Text)
        oF59M.nombree = UCase(txtnombre.Text)
        oF59M.docc = UCase(txtdoc.Text)
        oF59M.domicilioo = UCase(txtdomicilio.Text)
        oF59M.numm = UCase(txtnum.Text)
        oF59M.pisoo = UCase(txtpiso.Text)
        oF59M.dptoo = UCase(txtdpto.Text)
        oF59M.localidadd = UCase(txtlocalidad.Text)
        oF59M.provinciaa = UCase(txtprovincia.Text)
        oF59M.codpostall = UCase(txtcodpostal.Text)
        oF59M.matriculaa = UCase(txtmatricula.Text)
        oF59M.matriculamandd = UCase(txtmatriculamand.Text)
        oF59M.dominioo = UCase(txtdominio.Text)
        oF59M.tramitee = UCase(txttramite.Text)
        oF59M.solicitudtipoo = UCase(txtsolicitudtipo.Text)
        oF59M.numerocontroll = UCase(txtnumerocontrol.Text)
        oF59M.observacioness = UCase(txtobservaciones.Text)


        Try
            If oF59MNegocios.editarF01MA(oF59M) Then
                MsgBox("La edición ha sido exitosa", MsgBoxStyle.MsgBoxSetForeground, "Información")
            End If
        Catch ex As Exception
            MsgBox("Edición fallida. " + ex.Message, MsgBoxStyle.MsgBoxSetForeground, "Información")
        End Try
    End Sub

    Private Sub btnNuevo_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnNuevo.Click
        txtnumcontrol.Text = ""
        txtapellido.Text = ""
        txtnombre.Text = ""
        txtdoc.Text = ""
        txtdomicilio.Text = ""
        txtnum.Text = ""
        txtpiso.Text = ""
        txtdpto.Text = ""
        txtlocalidad.Text = ""
        txtprovincia.Text = ""
        txtcodpostal.Text = ""
        txtmatricula.Text = ""
        txtmatriculamand.Text = ""
        txtdominio.Text = ""
        txttramite.Text = ""
        txtsolicitudtipo.Text = ""
        txtnumerocontrol.Text = ""
        txtobservaciones.Text = ""

    End Sub

    Private Sub btnsalir_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnsalir.Click
        Me.Close()
    End Sub

    Private Sub btnF01V_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnF01V.Click
        F01_V_anverso_.Show()
        Me.Close()
    End Sub

    Private Sub btnF01M_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnF01M.Click
        F01_M_anverso_.Show()
        Me.Close()
    End Sub

    Private Sub btnF01I_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnF01I.Click
        F01_VImp_anverso_.Show()
        Me.Close()
    End Sub

    Private Sub btnF02V_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnF02V.Click
        F02_V_anverso_.Show()
        Me.Close()
    End Sub

    Private Sub btnF02M_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnF02M.Click
        F02_M_anverso_.Show()
        Me.Close()
    End Sub

    Private Sub btnF04V_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnF04V.Click
        F04_V_anverso_.Show()
        Me.Close()
    End Sub

    Private Sub btn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn.Click
        F04_M_anverso_.Show()
        Me.Close()
    End Sub

    Private Sub btnF08V_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnF08V.Click
        F08_V_anverso_.Show()
        Me.Close()
    End Sub

    Private Sub btnF08M_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnF08M.Click
        F08_M_anverso_.Show()
        Me.Close()
    End Sub

    Private Sub btnF11V_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnF11V.Click
        F11_V_anverso_.Show()
        Me.Close()

    End Sub

    Private Sub btnF11M_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnF11M.Click
        F11_M_anverso_.Show()
        Me.Close()

    End Sub

    Private Sub btnF12V_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnF12V.Click
        F12_V.Show()
        Me.Close()
    End Sub

    Private Sub btnF12M_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnF12M.Click
        F12_M.Show()
        Me.Close()
    End Sub

    Private Sub btnF99_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnF99.Click
        F99.Show()
        Me.Close()
    End Sub


    Private Sub btnFR00_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnFR00.Click
        F_R00.Show()
        Me.Close()
    End Sub

    Private Sub btnReverso_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnReverso.Click
        MsgBox("El presente formulario no posee lado Reverso", MsgBoxStyle.DefaultButton1, Title:="INFORMACIÓN")
    End Sub
End Class
